<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:dfs-dm-core="http://core.datamodel.fs.documentum.emc.com/" xmlns:tns="http://query.core.datamodel.fs.documentum.emc.com/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:dfs-dm-core-schema="http://schema.core.datamodel.fs.documentum.emc.com/" xmlns:ns1="http://properties.core.datamodel.fs.documentum.emc.com/" xmlns:dfs-rt="http://rt.fs.documentum.emc.com/" xmlns:dfs-dm-core-query="http://query.core.datamodel.fs.documentum.emc.com/" elementFormDefault="qualified" targetNamespace="http://query.core.datamodel.fs.documentum.emc.com/" version="1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:import schemaLocation="http://skaro.spacetime.com:18888/services/core/SearchService?xsd=2" namespace="http://schema.core.datamodel.fs.documentum.emc.com/" />
  <xs:import schemaLocation="http://skaro.spacetime.com:18888/services/core/SearchService?xsd=7" namespace="http://core.datamodel.fs.documentum.emc.com/" />
  <xs:import schemaLocation="http://skaro.spacetime.com:18888/services/core/SearchService?xsd=5" namespace="http://properties.core.datamodel.fs.documentum.emc.com/" />
  <xs:complexType name="Query" abstract="true">
    <xs:sequence>
      <xs:element minOccurs="0" maxOccurs="unbounded" name="repositories" type="xs:string" />
      <xs:element minOccurs="0" name="transientId" type="xs:string" />
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="StructuredQuery">
    <xs:complexContent mixed="false">
      <xs:extension base="dfs-dm-core-query:Query">
        <xs:sequence>
          <xs:element minOccurs="0" maxOccurs="unbounded" name="scopes" type="dfs-dm-core-query:RepositoryScope" />
          <xs:element minOccurs="0" name="rootExpressionSet" type="dfs-dm-core-query:ExpressionSet" />
          <xs:element minOccurs="0" maxOccurs="unbounded" name="orderByClauses" type="dfs-dm-core-query:OrderByClause" />
        </xs:sequence>
        <xs:attribute name="objectType" type="xs:string" />
        <xs:attribute name="dateFormat" type="xs:string" />
        <xs:attribute name="isDatabaseSearch" type="xs:boolean" use="required" />
        <xs:attribute name="isIncludeAllVersions" type="xs:boolean" use="required" />
        <xs:attribute name="isIncludeHidden" type="xs:boolean" use="required" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="RepositoryScope">
    <xs:sequence />
    <xs:attribute name="repositoryName" type="xs:string" />
    <xs:attribute name="locationPath" type="xs:string" />
    <xs:attribute name="isDescend" type="xs:boolean" use="required" />
    <xs:attribute name="isExcluded" type="xs:boolean" use="required" />
  </xs:complexType>
  <xs:complexType name="ExpressionSet">
    <xs:complexContent mixed="false">
      <xs:extension base="dfs-dm-core-query:Expression">
        <xs:sequence>
          <xs:element minOccurs="0" maxOccurs="unbounded" name="expressions" type="dfs-dm-core-query:Expression" />
        </xs:sequence>
        <xs:attribute name="operator" type="dfs-dm-core-query:ExpressionSetOperator" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Expression" abstract="true">
    <xs:sequence />
  </xs:complexType>
  <xs:complexType name="FullTextExpression">
    <xs:complexContent mixed="false">
      <xs:extension base="dfs-dm-core-query:Expression">
        <xs:sequence />
        <xs:attribute name="value" type="xs:string" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="PropertyExpression">
    <xs:complexContent mixed="false">
      <xs:extension base="dfs-dm-core-query:Expression">
        <xs:sequence>
          <xs:element minOccurs="0" name="value" type="dfs-dm-core-query:ExpressionValue" />
        </xs:sequence>
        <xs:attribute name="property" type="xs:string" />
        <xs:attribute name="condition" type="dfs-dm-core-query:Condition" />
        <xs:attribute name="dataType" type="dfs-dm-core-schema:DataType" />
        <xs:attribute name="isRepeated" type="xs:string" />
        <xs:attribute name="isCaseSensitive" type="xs:boolean" use="required" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ExpressionValue" abstract="true">
    <xs:sequence />
  </xs:complexType>
  <xs:complexType name="RangeValue">
    <xs:complexContent mixed="false">
      <xs:extension base="dfs-dm-core-query:ExpressionValue">
        <xs:sequence />
        <xs:attribute name="fromValue" type="xs:string" />
        <xs:attribute name="toValue" type="xs:string" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="RelativeDateValue">
    <xs:complexContent mixed="false">
      <xs:extension base="dfs-dm-core-query:ExpressionValue">
        <xs:sequence />
        <xs:attribute name="value" type="xs:int" use="required" />
        <xs:attribute name="unit" type="dfs-dm-core-query:TimeUnit" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="SimpleValue">
    <xs:complexContent mixed="false">
      <xs:extension base="dfs-dm-core-query:ExpressionValue">
        <xs:sequence />
        <xs:attribute name="value" type="xs:string" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="ValueList">
    <xs:complexContent mixed="false">
      <xs:extension base="dfs-dm-core-query:ExpressionValue">
        <xs:sequence>
          <xs:element minOccurs="0" maxOccurs="unbounded" name="values" type="xs:string" />
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="OrderByClause">
    <xs:sequence />
    <xs:attribute name="attribute" type="xs:string" />
    <xs:attribute name="isAscending" type="xs:boolean" use="required" />
  </xs:complexType>
  <xs:complexType name="PassthroughQuery">
    <xs:complexContent mixed="false">
      <xs:extension base="dfs-dm-core-query:Query">
        <xs:sequence />
        <xs:attribute name="queryString" type="xs:string" />
        <xs:attribute name="typeAlias" type="xs:string" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="QueryExecution">
    <xs:sequence />
    <xs:attribute name="queryId" type="xs:string" />
    <xs:attribute name="startingIndex" type="xs:long" use="required" />
    <xs:attribute name="maxResultCount" type="xs:int" use="required" />
    <xs:attribute name="maxResultPerSource" type="xs:int" use="required" />
    <xs:attribute name="cacheStrategyType" type="dfs-dm-core:CacheStrategyType" />
  </xs:complexType>
  <xs:complexType name="ClusteringStrategy">
    <xs:complexContent mixed="false">
      <xs:extension base="dfs-dm-core-query:GroupingStrategy">
        <xs:sequence>
          <xs:element minOccurs="0" maxOccurs="unbounded" name="attributes" type="xs:string" />
          <xs:element minOccurs="0" name="tokenizers" type="ns1:PropertySet" />
        </xs:sequence>
        <xs:attribute name="clusteringRange" type="dfs-dm-core-query:ClusteringRange" />
        <xs:attribute name="clusteringThreshold" type="xs:int" use="required" />
        <xs:attribute name="strategyName" type="xs:string" />
        <xs:attribute name="returnIdentitySet" type="xs:boolean" use="required" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="GroupingStrategy" abstract="true">
    <xs:sequence />
  </xs:complexType>
  <xs:complexType name="QueryCluster">
    <xs:sequence>
      <xs:element minOccurs="0" maxOccurs="unbounded" name="ClusterTrees" type="dfs-dm-core-query:ClusterTree" />
      <xs:element minOccurs="0" name="queryStatus" type="dfs-dm-core-query:QueryStatus" />
    </xs:sequence>
    <xs:attribute name="queryId" type="xs:string" />
  </xs:complexType>
  <xs:complexType name="ClusterTree">
    <xs:complexContent mixed="false">
      <xs:extension base="dfs-dm-core-query:GroupingTree">
        <xs:sequence>
          <xs:element minOccurs="0" maxOccurs="unbounded" name="Clusters" type="dfs-dm-core-query:Cluster" />
          <xs:element minOccurs="0" name="Strategy" type="dfs-dm-core-query:ClusteringStrategy" />
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="GroupingTree" abstract="true">
    <xs:sequence />
  </xs:complexType>
  <xs:complexType name="Cluster">
    <xs:complexContent mixed="false">
      <xs:extension base="dfs-dm-core-query:Grouping">
        <xs:sequence>
          <xs:element minOccurs="0" maxOccurs="unbounded" name="clusterValues" type="xs:string" />
          <xs:element minOccurs="0" name="ClusterObjectsIdentities" type="dfs-dm-core:ObjectIdentitySet" />
        </xs:sequence>
        <xs:attribute name="clusterSize" type="xs:int" use="required" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="Grouping" abstract="true">
    <xs:sequence />
  </xs:complexType>
  <xs:complexType name="QueryStatus">
    <xs:sequence>
      <xs:element minOccurs="0" maxOccurs="unbounded" name="RepositoryStatusInfos" type="dfs-dm-core-query:RepositoryStatusInfo" />
    </xs:sequence>
    <xs:attribute name="hasMoreResults" type="xs:boolean" use="required" />
    <xs:attribute name="isCompleted" type="xs:boolean" use="required" />
  </xs:complexType>
  <xs:complexType name="RepositoryStatusInfo">
    <xs:sequence>
      <xs:element minOccurs="0" name="errorTrace" type="xs:string" />
    </xs:sequence>
    <xs:attribute name="name" type="xs:string" />
    <xs:attribute name="status" type="dfs-dm-core-query:Status" />
    <xs:attribute name="detailedStatus" type="dfs-dm-core-query:RepositoryStatus" />
    <xs:attribute name="errorMessage" type="xs:string" />
    <xs:attribute name="hitCount" type="xs:int" use="required" />
    <xs:attribute name="resultsCount" type="xs:int" use="required" />
    <xs:attribute name="hasMoreResults" type="xs:boolean" use="required" />
  </xs:complexType>
  <xs:complexType name="Repository">
    <xs:sequence>
      <xs:element minOccurs="0" name="properties" type="dfs-dm-core-query:RepositoryProperty" />
    </xs:sequence>
    <xs:attribute name="name" type="xs:string" />
    <xs:attribute name="type" type="dfs-dm-core-query:RepositoryType" />
  </xs:complexType>
  <xs:complexType name="RepositoryProperty">
    <xs:sequence />
    <xs:attribute name="homeUrl" type="xs:string" />
    <xs:attribute name="description" type="xs:string" />
    <xs:attribute name="logicalOrExpressionSetCapability" type="xs:string" />
    <xs:attribute name="hiddenObjectsCapability" type="xs:string" />
    <xs:attribute name="allVersionsCapability" type="xs:string" />
    <xs:attribute name="duplicateRemovalCapabilities" type="xs:string" />
    <xs:attribute name="ftdqlCapability" type="xs:string" />
    <xs:attribute name="tryFTDQLFirstCapability" type="xs:string" />
    <xs:attribute name="loginCapability" type="xs:string" />
    <xs:attribute name="userLoginCapability" type="xs:string" />
    <xs:attribute name="defaultLoginCapability" type="xs:string" />
  </xs:complexType>
  <xs:complexType name="QueryResult">
    <xs:sequence>
      <xs:element minOccurs="0" name="dataPackage" type="dfs-dm-core:DataPackage" />
      <xs:element minOccurs="0" name="queryStatus" type="dfs-dm-core-query:QueryStatus" />
    </xs:sequence>
    <xs:attribute name="queryId" type="xs:string" />
  </xs:complexType>
  <xs:simpleType name="ExpressionSetOperator">
    <xs:restriction base="xs:string">
      <xs:enumeration value="AND" />
      <xs:enumeration value="OR" />
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="Condition">
    <xs:restriction base="xs:string">
      <xs:enumeration value="UNDEFINED" />
      <xs:enumeration value="EQUAL" />
      <xs:enumeration value="NOT_EQUAL" />
      <xs:enumeration value="GREATER_THAN" />
      <xs:enumeration value="LESS_THAN" />
      <xs:enumeration value="GREATER_EQUAL" />
      <xs:enumeration value="LESS_EQUAL" />
      <xs:enumeration value="BEGINS_WITH" />
      <xs:enumeration value="CONTAINS" />
      <xs:enumeration value="DOES_NOT_CONTAIN" />
      <xs:enumeration value="ENDS_WITH" />
      <xs:enumeration value="IN" />
      <xs:enumeration value="NOT_IN" />
      <xs:enumeration value="BETWEEN" />
      <xs:enumeration value="IS_NULL" />
      <xs:enumeration value="IS_NOT_NULL" />
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="TimeUnit">
    <xs:restriction base="xs:string">
      <xs:enumeration value="MILLISECOND" />
      <xs:enumeration value="SECOND" />
      <xs:enumeration value="MINUTE" />
      <xs:enumeration value="HOUR" />
      <xs:enumeration value="DAY" />
      <xs:enumeration value="WEEK" />
      <xs:enumeration value="MONTH" />
      <xs:enumeration value="YEAR" />
      <xs:enumeration value="ERA" />
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="ClusteringRange">
    <xs:restriction base="xs:string">
      <xs:enumeration value="LOW" />
      <xs:enumeration value="MEDIUM" />
      <xs:enumeration value="HIGH" />
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="Status">
    <xs:restriction base="xs:string">
      <xs:enumeration value="SUCCESS" />
      <xs:enumeration value="FAILURE" />
      <xs:enumeration value="RUNNING" />
      <xs:enumeration value="STOPPED" />
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="RepositoryStatus">
    <xs:restriction base="xs:string">
      <xs:enumeration value="TRUNCATED" />
      <xs:enumeration value="INTERNAL_FAILURE" />
      <xs:enumeration value="NOT_CONSTRAINED" />
      <xs:enumeration value="UNREACHABLE" />
      <xs:enumeration value="LOGIN_FAILED" />
      <xs:enumeration value="COULD_NOT_FETCH" />
      <xs:enumeration value="EXT_SOURCE_UNAVAILABLE" />
      <xs:enumeration value="UNAVAILABLE" />
      <xs:enumeration value="QUERY_SCOPE_UNREACHABLE" />
      <xs:enumeration value="WAS_STOPPED" />
      <xs:enumeration value="EXPIRED" />
      <xs:enumeration value="TYPE_NOT_SUPPORTED" />
      <xs:enumeration value="OVERLOADED" />
      <xs:enumeration value="TOO_MANY_RESULTS" />
      <xs:enumeration value="QUERY_SYNTAX_NOT_VALID" />
      <xs:enumeration value="WILDCARD_SYNTAX_ERROR" />
      <xs:enumeration value="UNSUPPORTED_ATTRIBUTE_ERROR" />
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="RepositoryType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="MANAGED" />
      <xs:enumeration value="EXTERNAL" />
    </xs:restriction>
  </xs:simpleType>
</xs:schema>